<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        window.onload = function () {
            var ul_1 = document.getElementById("ul_1"); //通过id属性，只能找见唯一一个html元素
            console.log("ul_1="+ul_1);
            var ul_2 = document.getElementById("ul_2");
            console.log("ul_2="+ul_2);

            var ul = document.getElementsByTagName("ul"); //找见的是网页中所有的ul元素
            console.log("ul="+ul);
            console.log(ul.length);

        }
    </script>
</head>
<body>
  <ul id="ul_1">
      <li>1</li>
      <li>2</li>
  </ul>

  <ul id="ul_2">
      <li>3</li>
      <li>4</li>
  </ul>
</body>
</html>